﻿using System;

namespace CNVP.JShop.Publish
{
    /// <summary>
    /// 标签参数
    /// </summary>
    public struct LabelParameter
    {
        /// <summary>
        /// 参数名称
        /// </summary>
        public string LPName;
        /// <summary>
        /// 参数值
        /// </summary>
        public string LPValue;
    }
    /// <summary>
    /// 标签类
    /// </summary>
    public class Label
    {
        /// <summary>
        /// 标签名称
        /// </summary>
        protected string _LabelName = string.Empty;
        /// <summary>
        /// 最终的HTML代码
        /// </summary>
        protected string _FinalHtmlCode = string.Empty;
        /// <summary>
        /// 当前的模板类型
        /// </summary>
        protected TempType _TemplateType;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="labelname">标签名称</param>
        public Label(string labelname)
        {
            _LabelName = labelname;
        }
        /// <summary>
        /// 标签名称
        /// </summary>
        public string LabelName
        {
            get { return _LabelName; }
        }
        /// <summary>
        /// 从数据库取得标签的内容
        /// </summary>
        /// <param name="cn"></param>
        public virtual void GetContentFromDB()
        {
        }
        /// <summary>
        /// 生成最终的HTML代码
        /// </summary>
        /// <param name="cn"></param>
        public virtual void MakeHtmlCode()
        {
        }
        /// <summary>
        /// 最终的标签HTML代码
        /// </summary>
        public string FinalHtmlCode
        {
            get { return _FinalHtmlCode; }
        }
        /// <summary>
        /// 设置或获取当前的模板类型
        /// </summary>
        public TempType TemplateType
        {
            set { _TemplateType = value; }
            get { return _TemplateType; }
        } 
    }
}